<!--
 Copyright (c) 2018
 Mainflux

 SPDX-License-Identifier: Apache-2.0
-->

<div *mobxAutorun>
    <div class="loading" *ngIf="uiStore.loading" fxLayoutAlign="center center">
        <mat-progress-spinner [mode]="'indeterminate'"></mat-progress-spinner>
    </div>
    <mat-toolbar color="primary" class="mat-elevation-z6">
        <h1 fxFlex>Mainflux</h1>
        <ng-container *ngIf="authStore.isAuthenticated">
            <a [routerLink]="['/things']" mat-button>Things</a>
            <a [routerLink]="['/channels']" mat-button>Channels</a>
            <a (click)="logout()" mat-button>Logout</a>
        </ng-container>

    </mat-toolbar>
    <router-outlet></router-outlet>
</div>
